<%@ page contentType="text/html;charset=ISO8859_1" language="java" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-nested.tld" prefix="nested" %>

<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<jsp:useBean id="context" type="laya.semi.process.IProcessContext" scope="request" />
<jsp:useBean id="oNavigate" class="git.bankview.wl.bean.TransNavigateBean" />
<jsp:setProperty name="oNavigate" property="transid" value="90010" />

<html:html locale="true">
<head>
	<title><logic:iterate id="element" name="oNavigate" property="navigateList"
	><bean:write name="element" property="translabel" />
	 - </logic:iterate><bean:message key="report.NewReportTrans.title" /></title>
	<!-- title><bean:message key="report.NewReportTrans.title" /></title -->
	<link rel="stylesheet" href="../style/default_aux.css">
	<link rel="stylesheet" href="../style/pp.css">
</head>
<body onload="oninit();">
	<script src="../script/overlib.js" language="JavaScript"></script>
	<script src="../script/style.js" language="JavaScript"></script>
	<script src="../script/windows.js" language="JavaScript"></script>
	<table cellspacing="0" class="filledframe">
		<tr>
			<td nowrap="" class="clientframe">
				<table id="oHelp" class="helper" >
					<tr>
						<td width="200" class="label">&nbsp;</td>
						<td class="help"><input type="button" class="button" title="<bean:message key="common.help.title" />" onclick="help('help.report.schd');" value="<bean:message key="common.help" />" ></td>
					</tr>
				</table>
				<html:form action="/report/NewReportTrans" styleId="oNewForm" onsubmit="return onSubmitCheck()">
					<input type="hidden" name="pageUrl" value="<html:rewrite action="/report/ReportSchdList" />" />
					<div class="listtitle"><logic:iterate id="element" name="oNavigate" property="navigateList"
						><logic:empty name="element" property="pageurl"><bean:write name="element" property="translabel" /></logic:empty
						><logic:notEmpty name="element" property="pageurl"><a href="<bean:write name="element" property="pageurl" />" title="<bean:write name="element" property="transid" />"><bean:write name="element" property="translabel" /></a></logic:notEmpty
						><img src="/images/navconn.gif" ></logic:iterate><bean:message key="report.NewReportTrans.title" 
						/></div>
					<div class="subtitle"><bean:message key="report.newTrans.step2" />
						<br><html:errors /></div>
					<table id="oPropPagesTab">
						<tr><td style="padding: 50px;"><h5><bean:message key="report.pp.wait" /></h5></td></tr></table>
					<!---------------- generial information properties page BEGIN ----------------->
					<div id="ppGeneral">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="infotrans.ptransid" />:</td>
								<td nowrap ><html:text property="ptransid" readonly="true" size="5" maxlength="5" styleClass="text" styleId="oPtransid" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="101" onchange="onPtransidChange(this.value);" /> <html:errors property="needPtransid" /></td>
									<td width="5"><img src="/images/spacer.gif"></td><td><input type="button" class="btedit" onclick="openNavigator('<html:rewrite action="/report/ReportGroupNavigator" />', 'oPtransid', 222, 420, '_blank', 'parent=00000')"></td>
								<td nowrap class="remark" id="oGroupTranslabel" width="160">&nbsp;</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="infotrans.transid" />:</td>
								<td nowrap ><html:text property="transid" size="5" maxlength="5" styleClass="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="102" /> <html:errors property="needTransid" /></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="infotrans.translabel" />:</td>
								<td nowrap ><html:text property="translabel" size="32" maxlength="32" styleClass="text" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="105" /> <html:errors property="needTranslabel" /></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.authSettings" />:</td>
								<td nowrap >
									<%	String[] deptAuth = (String[])context.getField("REPORT_DEPT_AUTH");
										String[] userAuth = (String[])context.getField("REPORT_USER_AUTH"); %>
									<input type="checkbox" name="REPORT_DEPT_AUTH" value="1" tabindex="115" <%=(null == deptAuth || 0 == deptAuth.length ? "" : "checked")%> > <bean:message key="report.prop.deptAuth" />
									<logic:iterate id="element" name="jasperParams">
										<logic:equal name="element" property="name" value="GRP_DEPT_NO">
											</logic:equal>
										<logic:equal name="element" property="name" value="GRP_USER_ID">
											<input type="checkbox" name="REPORT_USER_AUTH" value="1" tabindex="115" <%=(null == userAuth || 0 == userAuth.length ? "" : "checked")%> > <bean:message key="report.prop.userAuth" /></logic:equal>
									</logic:iterate>
								</td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- generial information properties page END ----------------->
					
					<!---------------- schd properties page BEGIN ----------------->
					<div id="ppSchd">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="dqreportschd.schdtype" />/<bean:message key="report.prop.schdDateFmt" />:</td>
								<td nowrap >
									<select name="oSchdTempList" tabindex="211" >
										<option value="0"><bean:message key="dqreportschd.schdtype.d0" /></option>
										<option value="1"><bean:message key="dqreportschd.schdtype.d1" /></option>
										<option value="5"><bean:message key="dqreportschd.schdtype.d5" /></option>
										<option value="7"><bean:message key="dqreportschd.schdtype.d7" /></option>
										<option value="10"><bean:message key="dqreportschd.schdtype.d10" /></option>
										<option value="15"><bean:message key="dqreportschd.schdtype.d15" /></option>
										<option value="30"><bean:message key="dqreportschd.schdtype.d30" /></option>
										<option value="90"><bean:message key="dqreportschd.schdtype.d90" /></option>
										<option value="180"><bean:message key="dqreportschd.schdtype.d180" /></option>
										<option value="360"><bean:message key="dqreportschd.schdtype.d360" /></option>
									</select><br>
								</td>
								<td nowrap>&nbsp;/&nbsp;</td>
								<td nowrap>
									<input name="oSchdTemp" tabindex="212" type="text" class="text" size="12" maxlength="10" title="<bean:message key="common.aboutDateFormat" />" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="return onDateFieldBlur()">
								</td><td width="61"><img src="/images/spacer.gif"></td><td nowrap>
									<input type="button" tabindex="215" class="button" value="<bean:message key="common.add" />" onclick="onAddSchdTemp()">
									<input type="button" tabindex="216" class="button" value="<bean:message key="common.delete" />" onclick="deleteSelectedRow(oTempList)">
									</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.schdTemp" />:</td>
								<td nowrap width="300" rowspan="2">
									<div id="oTempList"></div>
								</td>
							</tr><tr><td><img src="/images/spacer.gif"></td></tr></table></td></tr>
							<tr><td class="line"><hr></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.paramEnum" />:</td>
								<%	String[] vParamEnum = (String[])context.getField("REPORT_PARAM_ENUM"); 
									String paramEnum = (null == vParamEnum || 0 == vParamEnum.length ? null : vParamEnum[0].trim()); %>
								<td nowrap >
									<select name="REPORT_PARAM_ENUM" tabindex="225" >
										<option value="">(<bean:message key="common.selecting" />)</option>
										<option value="git.bankview.sl.report.BranchRootEnumeration" 
											<%="git.bankview.sl.report.BranchRootEnumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.BranchRootEnumeration" /></option>
										<option value="git.bankview.sl.report.BranchLevel2Enumeration"
											<%="git.bankview.sl.report.BranchLevel2Enumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.BranchLevel2Enumeration" /></option>
										<option value="git.bankview.sl.report.BranchLevel3Enumeration"
											<%="git.bankview.sl.report.BranchLevel3Enumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.BranchLevel3Enumeration" /></option>
										<option value="git.bankview.sl.report.BranchAllEnumeration"
											<%="git.bankview.sl.report.BranchAllEnumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.BranchAllEnumeration" /></option>
										<option value="git.bankview.sl.report.BranchGeLevel2Enumeration"
											<%="git.bankview.sl.report.BranchGeLevel2Enumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.BranchGeLevel2Enumeration" /></option>
										<option value="git.bankview.sl.report.ParameterlessEnumeration"
											<%="git.bankview.sl.report.ParameterlessEnumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.ParameterlessEnumeration" /></option>
										<option value="git.bankview.sl.report.CalculateByBranchLevel1Enumeration"
											<%="git.bankview.sl.report.CalculateByBranchLevel1Enumeration".equals(paramEnum) ? "selected" : ""%> ><bean:message key="git.bankview.sl.report.CalculateByBranchLevel1Enumeration" /></option>
									</select> <html:errors property="needParamEnum" /></td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<%	String[] vExport = (String[])context.getField("REPORT_SCHD_EXPORT"); 
									boolean bXls = false; 
									boolean bPdf = false; 
									boolean bXml = false; 
									boolean bHtm = false; 
									boolean bCsv = false; 
									
									for (int i = 0; null != vExport && i < vExport.length; ++i)
									{
										if ("XLS".equals(vExport[i]))
											bXls = true;
										else if ("PDF".equals(vExport[i]))
											bPdf = true;
										else if ("XML".equals(vExport[i]))
											bXml = true;
										else if ("HTM".equals(vExport[i]))
											bHtm = true;
										else if ("CSV".equals(vExport[i]))
											bCsv = true;
									}
								%>
								<td nowrap class="label"><bean:message key="dqreportschd.schdexport" />:</td>
								<td nowrap >
									<input type="checkbox" name="REPORT_SCHD_EXPORT" value="XLS" tabindex="230" <%=bXls ? "checked" : ""%> > <bean:message key="dqreportschd.schdexport.xls" />
									<input type="checkbox" name="REPORT_SCHD_EXPORT" value="PDF" tabindex="230" <%=bPdf ? "checked" : ""%> > <bean:message key="dqreportschd.schdexport.pdf" />
									<input type="checkbox" name="REPORT_SCHD_EXPORT" value="XML" tabindex="230" <%=bXml ? "checked" : ""%> > <bean:message key="dqreportschd.schdexport.xml" />
									<input type="checkbox" name="REPORT_SCHD_EXPORT" value="HTM" tabindex="230" <%=bHtm ? "checked" : ""%> > <bean:message key="dqreportschd.schdexport.htm" />
									<input type="checkbox" name="REPORT_SCHD_EXPORT" value="CSV" tabindex="230" <%=bCsv ? "checked" : ""%> onclick="onExportCsvClick(this); " > <bean:message key="dqreportschd.schdexport.csv" />
									<html:errors property="needPropSchdExport" />
								</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="load.policyLabel" />:</td>
								<td nowrap >
									<select name="oLoadPolicyList" tabindex="241" <%=!bCsv ? "disabled" : ""%> onchange="onLoadPolicyChange(this)" >
										<option value="">(<bean:message key="common.selecting" />)</option>
										<option value="APPEND"><bean:message key="load.policy.append" /></option>
										<option value="UNION"><bean:message key="load.policy.union" /></option>
										<option value="UPDATEONLY"><bean:message key="load.policy.updateOnly" /></option>
										<option value="EMPTYSCHDFIRST"><bean:message key="load.policy.emptySchdFirst" /></option>
										<option value="EMPTYTABFIRST"><bean:message key="load.policy.emptyTableFirst" /></option>
									</select><br>
								</td>
								<td nowrap id="oLoadPolicyDesc" style="padding-left: 15px; ">&nbsp;</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="load.toTable" />:</td>
								<td nowrap ><input type="text" name="loadToTable" size="16" maxlength="16" class="text" <%=!bCsv ? "disabled" : ""%> onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="245" /> <html:errors property="needLoadPolicy" /></td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- schd properties page END ----------------->

					<!---------------- depends page BEGIN ----------------->
					<div id="ppDepends">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="dqreportschd.dependTrans" />:</td>
								<td nowrap ><input type="text" readonly="true" size="5" maxlength="5" class="text" id="oDependTrans" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="271" onchange="onDependenceChange(this.value);" /> <html:errors property="needDependTrans" /></td>
									<td width="5"><img src="/images/spacer.gif"></td><td><input type="button" class="btedit" onclick="openNavigator('<html:rewrite action="/report/ReportNavigator" />', 'oDependTrans', 222, 420, '_blank', 'parent=00000')"></td>
								<td nowrap class="remark" id="oDependenceTranslabel" width="155">&nbsp;</td>
								<td nowrap>
									<input type="button" tabindex="275" class="button" value="<bean:message key="common.add" />" onclick="onAddDependTrans()">
									<input type="button" tabindex="276" class="button" value="<bean:message key="common.delete" />" onclick="deleteSelectedRow(oDependTransList)">
									</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">&nbsp;</td>
								<td nowrap width="300">
									<div id="oDependTransList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="line"><hr></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="dqreportschd.dependTable" />:</td>
								<td nowrap ><input type="text" size="20" maxlength="16" class="text" id="oDependTable" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="onFieldBlur()" tabindex="281" /> <html:errors property="needDependTable" /></td>
								<td width="81"><img src="/images/spacer.gif"></td>
								<td nowrap>
									<input type="button" tabindex="285" class="button" value="<bean:message key="common.add" />" onclick="onAddDependTable()">
									<input type="button" tabindex="286" class="button" value="<bean:message key="common.delete" />" onclick="deleteSelectedRow(oDependTableList)">
									</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label">&nbsp;</td>
								<td nowrap width="300">
									<div id="oDependTableList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- depends page END ----------------->
					
					<!---------------- object properties page BEGIN ----------------->
					<div id="ppObject">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.params" />:</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap width="440">
									<div id="oParamList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.props" />:</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap width="440">
									<div id="oPropList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- object properties page END ----------------->
					
					<!---------------- accessories page BEGIN ----------------->
					<div id="ppAccessories">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.pp.accessories" />:</td>
							</tr></table></td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap width="440">
									<div id="oAccessoryList"></div>
								</td>
							</tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- accessories page END ----------------->
					
					<!---------------- remark properties page BEGIN ----------------->
					<div id="ppRemark">
						<table width="100%" height="100%" cellspacing="0" class="formpanel">
							<tr><td class="toppad">&nbsp;</td></tr>
							<tr><td class="input"><table cellspacing="0"><tr>
								<td nowrap class="label"><bean:message key="report.prop.remark" /></td>
								<td nowrap rowspan="2"><textarea name="REPORT_REMARK" cols="45" rows="12" tabindex="601"><%
									String[] vRemark = (String[])context.getField("REPORT_REMARK");
									
									for (int i = 0; null != vRemark && i < vRemark.length; ++i)
									{
										out.print(vRemark[i]);
									}
								%></textarea> <html:errors property="needPropRemark" /></td>
							</tr><tr><td>&nbsp;</td></tr></table></td></tr>
							<tr><td class="bottompad">&nbsp;</td></tr>
						</table>
					</div>
					<!---------------- remark properties page END ----------------->
					
					<table width="500" class="formpanelbar">
						<tr>
							<td align="right" nowrap="">
								<html:submit tabindex="1001" styleClass="button"><bean:message key="common.submit" /></html:submit></td>
						</tr>
					</table>
				</html:form>
			</td>
			<!-- td id="oFrame" nowrap="" class="infoframe">&nbsp;</td -->
		</tr>
	</table>
	
	<iframe id="oDataGetter" style="display: none; "></iframe>
	
<script language="javascript">
function onDependTransItemSelect(row)
{
	oNewForm.oDependTrans.value = row.value;
	oNewForm.oDependTrans.fireEvent("onchange");
	return true;
}
function onDependTableItemSelect(row)
{
	oNewForm.oDependTable.value = row.value;
	oNewForm.oDependTable.fireEvent("onchange");
	return true;
}
function onTempItemSelect(row)
{
	var i;
	for (i = 0; i < oNewForm.oSchdTempList.options.length; ++i)
	{
		if (row.cells[0].innerText == oNewForm.oSchdTempList.options[i].text)
		{
			oNewForm.oSchdTempList.options[i].selected = true;
			break;
		}
	}
	oNewForm.oSchdTemp.value = row.cells[1].innerText;
	return true;
}
function oninit()
{
	initPropertyPageTable(oPropPagesTab, 500, 320);
	addPropertyPage(oPropPagesTab, ppGeneral, "<bean:message key="report.pp.general" />");
	addPropertyPage(oPropPagesTab, ppSchd, "<bean:message key="report.pp.schd" />");
	addPropertyPage(oPropPagesTab, ppDepends, "<bean:message key="report.pp.depends" />");
	addPropertyPage(oPropPagesTab, ppObject, "<bean:message key="report.pp.object" />");
	addPropertyPage(oPropPagesTab, ppAccessories, "<bean:message key="report.pp.accessories" />");
	addPropertyPage(oPropPagesTab, ppRemark, "<bean:message key="report.pp.remark" />");
	setPropertyPageActive(oPropPagesTab, 0);
	
	// init REPORT_SCHD_TEMPLATE ctrl
	initSelectControl(oTempList, "100%", 80, new Array("30%", "70%"), onTempItemSelect);
<%
	///////////////////////////////////////////////
	// load schd infos
	
	String[] vTemplate = (String[])context.getField("REPORT_SCHD_TEMPLATE"); 
	for (int i = 0; null != vTemplate && i < vTemplate.length; ++i)
	{%>
	{
		var strTmpl = "<%=vTemplate[i]%>";
		var pair = strTmpl.split(":");
		var schdTypeDesc = getSchdTypeDesc(pair[0]);
		var row = insertRow(oTempList, new Array(schdTypeDesc, pair[1]));
		row.value = strTmpl;
	}
	<%}

	String[] vLoadPolicy = (String[])context.getField("REPORT_LOAD_POLICY"); 
	String[] vLoadTable = (String[])context.getField("REPORT_LOAD_TABLE"); 
	for (int i = 0; null != vLoadPolicy && i < vLoadPolicy.length; ++i)
	{
%>
	oNewForm.loadToTable.value = "<%=vLoadTable[i]%>";
	selectOptionByValue(oNewForm.oLoadPolicyList, "<%=vLoadPolicy[i]%>");
<%
	}

	/////////////////////////////////////////////////
	// load dependences(trans and tables)
%>
	initSelectControl(oDependTransList, "100%", 80, new Array("100%"), onDependTransItemSelect);
	initSelectControl(oDependTableList, "100%", 80, new Array("100%"), onDependTableItemSelect);
<%	
	String[] vDepend = (String[])context.getField("REPORT_SCHD_DEPENDENCE");
	for (int i = 0; null != vDepend && i < vDepend.length; ++i)
	{%>
	{
		var strDepend = "<%=vDepend[i]%>";
		var row = insertRow(oDependTransList, new Array(strDepend));
		row.value = strDepend;
	}
	<%}

	String[] vDependTable = (String[])context.getField("REPORT_SCHD_DEPENDTABLE");
	for (int i = 0; null != vDependTable && i < vDependTable.length; ++i)
	{%>
	{
		var strDependTable = "<%=vDependTable[i]%>";
		var row = insertRow(oDependTableList, new Array(strDependTable));
		row.value = strDependTable;
	}
	<%}
%>
	// init jasper parameters control
	initSelectControl(oParamList, "100%", 100, new Array("30%", "40%", "30%"));
	<logic:iterate id="element" name="jasperParams">
	{
		var desc = "<bean:write name="element" property="quotableDescription" filter="false" />";
		
		insertRow(oParamList, 
			new Array("<bean:write name="element" property="name" />",
				(18 < desc.length ? desc.substring(0, 16) + "..." : desc), 
				"<bean:write name="element" property="valueClassName" />"));
	}
	</logic:iterate>
	
	// init jasper properties control
	initSelectControl(oPropList, "100%", 100, new Array("50%", "50%"));
	<logic:iterate id="element" name="jasperProps">
	insertRow(oPropList, 
		new Array("<bean:write name="element" property="propName" />",
			"<bean:write name="element" property="propValue" />"));
	</logic:iterate>
	
	// init accessories control
	initSelectControl(oAccessoryList, "100%", 180, new Array("50%", "20%", "30%"));
	var i = 0;
	<%-- logic:notEmpty name="accessoryFileNames">
		<logic:iterate id="element" name="accessoryFileNames">
		insertCheckboxRow(oAccessoryList, "selectedAccessories", i++, true,
			new Array("<bean:write name="element" />"));
		</logic:iterate>
	</logic:notEmpty --%>
	
<%	
	java.io.File[] vAccessory = (java.io.File[])session.getAttribute("accessories");
	
	if (null != vAccessory)
	{
		String[] vAccessoryNames = (String[])session.getAttribute("accessoryFileNames");
		java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm");
		for (int i = 0; i < vAccessory.length; ++i)
		{
%>
	{
		var row = insertCheckboxRow(oAccessoryList, "selectedAccessories", i++, true,
			new Array("<%=vAccessoryNames[i]%>"
			, "<%=git.bankview.wl.style.StyleUtil.formatSize(vAccessory[i].length())%>"
			, "<%=sdf.format(new java.util.Date(vAccessory[i].lastModified()))%>"));
		row.value = "<%=vAccessoryNames[i]%>";
	}
<%
		}
	}
%>	
}
function getSchdTypeDesc(n)
{
	for (j = 0; j < oNewForm.oSchdTempList.options.length; ++j)
	{
		if (n == oNewForm.oSchdTempList.options[j].value)
			return oNewForm.oSchdTempList.options[j].innerText;
	}
	
	alert("error to load schdtype!!!");
}
function onSubmitCheck()
{
	if (5 != oNewForm.transid.value.length)
	{
		alert("<bean:message key="infotrans.err.invalidTransId" />");
		return false;
	}
	
	if (0 == getAllRows(oTempList).length)
	{
		if (0 < getAllRows(oDependTransList).length ||
			0 < getAllRows(oDependTableList).length)
		{
			alert("<bean:message key="reportSchd.err.dependenceNotNeed" />");
			return false;
		}
	}
	else
	{
		setParameters(oNewForm, "REPORT_SCHD_TEMPLATE", oTempList, "value");
		setParameters(oNewForm, "REPORT_SCHD_DEPENDENCE", oDependTransList, "value");
		setParameters(oNewForm, "REPORT_SCHD_DEPENDTABLE", oDependTableList, "value");
	}
	
	if (!oNewForm.oLoadPolicyList.disabled && "" != oNewForm.oLoadPolicyList.value)
	{
		if (!oNewForm.REPORT_SCHD_EXPORT[4].checked)
		{
			alert("<bean:message key="load.err.needExportCsv" />");
			return false;
		}
		if (0 == oNewForm.loadToTable.value.length)
		{
			alert("<bean:message key="load.err.needLoadToTable" />");
			return false;
		}
		
		setParameter(oNewForm, "REPORT_LOAD_POLICY", oNewForm.oLoadPolicyList.value);
		setParameter(oNewForm, "REPORT_LOAD_TABLE", oNewForm.loadToTable.value);
	}

	oNewForm.pageUrl.value += "?transid=" + oNewForm.transid.value;
	
	return true;
}
function onAddSchdTemp()
{
	if (0 == oNewForm.oSchdTemp.value.length)
	{
		alert("<bean:message key="common.aboutDateFormat" />");
		return false;
	}
	
	var i;
	for (i = 0; i < oNewForm.oSchdTempList.options.length; ++i)
	{
		if (oNewForm.oSchdTempList.options[i].selected)
		{
			if (0 <= indexOfRow(oTempList, oNewForm.oSchdTempList.value + ":" + oNewForm.oSchdTemp.value))
			{
				alert("<bean:message key="common.insertDuplicateValue" />");
				return false;
			}

			var row = insertRow(oTempList, new Array(oNewForm.oSchdTempList.options[i].innerText, oNewForm.oSchdTemp.value));
			row.value = oNewForm.oSchdTempList.value + ":" + oNewForm.oSchdTemp.value;
			break;
		}
	}
}
function onAddDependTrans()
{
	if (5 != oNewForm.oDependTrans.value.length)
	{
		alert("<bean:message key="infotrans.err.invalidTransId" />");
		return false;
	}
	
	if (0 <= indexOfRow(oDependTransList, oNewForm.oDependTrans.value))
	{
		alert("<bean:message key="common.insertDuplicateValue" />");
		return false;
	}
	
	var row = insertRow(oDependTransList, new Array(oNewForm.oDependTrans.value));
	row.value = oNewForm.oDependTrans.value;
}
function onAddDependTable()
{
	if (0 == oNewForm.oDependTable.value.length)
	{
		alert("<bean:message key="reportSchd.err.emptyTableName" />");
		return false;
	}
	
	if (0 <= indexOfRow(oDependTableList, oNewForm.oDependTable.value))
	{
		alert("<bean:message key="common.insertDuplicateValue" />");
		return false;
	}
	
	var row = insertRow(oDependTableList, new Array(oNewForm.oDependTable.value));
	row.value = oNewForm.oDependTable.value;
}
function onPtransidChange(val)
{
	loadFieldText('<html:rewrite action="/report/TranslabelGetter" />', 'oGroupTranslabel', val);
}
function onDependenceChange(val)
{
	loadFieldText('<html:rewrite action="/report/TranslabelGetter" />', 'oDependenceTranslabel', val);
}
function onExportCsvClick(c)
{
	oNewForm.oLoadPolicyList.disabled = !c.checked;
	oNewForm.loadToTable.disabled = !c.checked;
}
function onLoadPolicyChange(c)
{
	if ("APPEND" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.appendDesc" />";
	else if ("UNION" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.unionDesc" />";
	else if ("UPDATEONLY" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.updateOnlyDesc" />";
	else if ("EMPTYSCHDFIRST" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.emptySchdFirstDesc" />";
	else if ("EMPTYTABFIRST" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.emptyTableFirstDesc" />";
	else
		oLoadPolicyDesc.innerText = " ";
}
</script>

</body>
</html:html>

